<?php

    echo $this->Html->css('jquery-gmaps.min', null, array('inline'=>false));
    echo $this->Html->script('https://maps.googleapis.com/maps/api/js?sensor=true&language=sr', array('inline' => false));
    echo $this->Html->script('jquery-gmaps-1.0.0.min');
    
?>

<div class="left contact-info">
    <h1><?= $settings['name'] ?></h1>
    <p><?= $settings['address'] ?></p>
    <p>tel: <?= $settings['phone'] ?></p>
    <p>mob: <?= $settings['mobile'] ?></p>
    
    <h2>Imate komentar, pitanje...</h2>
    <?= $this->Form->create('Contact', array('url'=>'/kontakt/send', 'id'=>'contact-form')) ?>
    
        <?= $this->Form->label('name', 'Ime:') ?>
        <?= $this->Form->text('name', array('value'=>@$data['Contact']['name'], 'required'=>false)) ?>
        <span class="error-container"><?= $this->Form->error('name') ?></span>
        
        <?= $this->Form->label('name', 'E-Mail:') ?>
        <?= $this->Form->text('email', array('value'=>@$data['Contact']['email'], 'required'=>false)) ?>
        <span class="error-container"><?= $this->Form->error('email') ?></span>
        
        <?= $this->Form->label('message', 'Poruka:') ?>
        <?= $this->Form->textarea('message', array('value'=>@$data['Contact']['message'], 'required'=>false)) ?>
        <span class="error-container"><?= $this->Form->error('message') ?></span>
        
        <br clear="all">
        <div class="captcha">
            <?= $this->Form->label('captcha', 'Tekst sa slike:') ?>
            <?= $this->Form->text('captcha', array('value'=>@$data['Contact']['captcha'], 'required'=>false)) ?>
            <?= $this->Html->image('/kontakt/captcha') ?>
            <span class="error-container"><?= $this->Form->error('captcha') ?></span>
        </div>
    
    <?= $this->Form->submit('Pošalji') ?>
    <?= $this->Form->end() ?>
</div>

<div class="right span50p" id="map">
    
</div>

<script type="text/javascript">
var pos = [<?= $settings['latlng'] ?>]

$(function(){
    
    $('#map').GMap({
        position: {lat: pos[0], lng: pos[1]},
        size: {width:400, height: 400},
        zoom: 16,
        language_strings: {
                Get_Directions:         "Kako doći do nas &raquo;",
                Directions:             "Kako doći do nas" ,
                Search:                 "Traži",
                Your_Address:           "Vaša adresa",
                Searching:              "Pretraga",
                Search_Results:         "Rezultati pretrage",
                Empty:                  "Prazno",
                Reset:                  "Poništi",
                Route_Impossible:       "Odabrana ruta nije izvodljiva"
        }

    })
});
</script>
